package com.ruoyi.orderEat.web;

public enum OrderStateCode {

    DINING(0,"用餐中"),
    AWAITING(1,"待支付"),

    APPEND(3,"追加订单"),
    PAID(2,"已支付");



    private Integer code;

    private String msg;

    OrderStateCode(Integer code, String message) {
        this.code = code;
        this.msg = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public boolean equals(String code) {
        if (this.code.equals(Integer.parseInt(code))) {
            return true;
        } else {
            return false;
        }
    }

    public boolean equals(Integer code) {
        if (this.code == code) {
            return true;
        } else {
            return false;
        }
    }

    public static String getDesc(Integer code) {
        OrderStateCode[] values = OrderStateCode.values();
        for (OrderStateCode value : values) {
            if (value.getCode().equals(code)) {
                return value.getMsg();
            }
        }
        return "";
    }


}
